<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/21
 * Time: 1:58
 */
header('Content-Type:application/json');
include '../classes/logincheck.php';
include '../classes/conn.php';
if(islogin()!='stu_login') {
    die("error");
}
$class=$_POST['class'];
$query="select * from notice where class='{$class}' or class is null";
$res=mysql_query($query);
$notice=array();
while ($row=mysql_fetch_assoc($res)){
    $notice[]=$row;
}

$data=json_encode($notice);
echo $data;